package com.spring.springboot.sys.core.config;

import com.baomidou.mybatisplus.core.config.GlobalConfig;
import com.spring.springboot.sys.core.interceptor.MetaHandler;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author 宋义州
 * @date 2022-08-09  23:12
 * @description 新增更新操作自动填充
 */
@Configuration
public class MyBatisPlusConfig {

    /**
     * 初始化mybatis-plus的GlobalConfig配置
     * 自动填充功能
     *
     * @return GlobalConfig
     */
    @Bean
    public GlobalConfig globalConfig() {
        GlobalConfig globalConfig = new GlobalConfig();
        globalConfig.setMetaObjectHandler(new MetaHandler());
        return globalConfig;
    }

}
